<?php
/**
 * 充值列表
 *
 * @author Alen
 * @since 1.0.0 2013-12-6 sutroon
 */
class Finance_Recharge_ListAction extends AdmincpAction {
    //put your code here
    public function index(){

        // 设置页面导航
        $this->set_breadcrumb(array('资金管理'=>'?m=Finance_Account_List','充值管理'=>'?m=Finance_Recharge_List'));
        // 设置页面标题
        $this->set_h1('充值管理','在这里管理所有充值申请');
        
        // 设置页面信息,如页面标题,meta信息等
        $this->set_page_info('充值管理');
        
        // 获取分页数据
        $biz=new SoBizRecharge();
        $dataset=null;
        $pager_text='';
        $biz->get_paging_data($pager_text, $dataset, request_numeric('page'), request_string('keyword'));
        
        $this->assign('pager',$pager_text);
        
        // 设置带分页条的搜索栏
        $this->set_search_with_pager($pager_text);
        
        // 构建数据表格
        $this->uig->begin_table();
        $this->uig->add_thead('#','流水号','会员名称','充值金额','状态','用户备注','申请时间','受理时间','审核备注','操作');
        
        if($dataset){
            if(!$this->biz) $this->biz=new SoBizCommon ();
            foreach($dataset as $row){
                $this->uig->add_trow($row['SerialNo'],$row['SerialNo'],$row['UserName'],$row['Amount'],$this->biz->get_state_name($row['State'],'recharge'),$row['UserRemark'],$row['CreatedTime'],$row['ModifiedTime'],$row['AdminRemark'],($row['State']==0?'<a href="?m=Finance_Recharge_Edit&n='.$row['SerialNo'].'">审核</a>':$this->biz->get_state_name($row['State'],'withdrawal')));
            }
        }
        $this->uig->end_table();
        $this->assign('table',$this->uig->get_text());
        
        // 设置统计信息
        $this->assign('blance_all',$biz->get_amount_all());
        $this->assign('blance_ok', $biz->get_amount_confirmed());
        $this->assign('blance_wait', $biz->get_amount_unconfirmed());
                
        // 显示模板
        $this->display();
    }
}